
from urllib import parse
import re, binascii, math, ctypes, time, random


def int_overflow(val):
    maxint = 2147483647
    if not -maxint-1 <= val <= maxint:
        val = (val + (maxint + 1)) % (2 * (maxint + 1)) - maxint - 1
    return val

def logical_rshift(signed_integer, places, num_bits=32):
    unsigned_integer = signed_integer % (1 << num_bits)
    return unsigned_integer >> places

def le(e, t):
    t %= 32
    return logical_rshift(int_overflow(e << t) | logical_rshift(e, 32 - t), 0)

def be(e):
    return 2043430169 if 0 <= e and e < 16 else (2055708042 if 16 <= e and e < 64 else -1)
    # return 0 <= e && e < 16 ? 2043430169 : 16 <= e && e < 64 ? 2055708042 : void console.error("invalid j for constant Tj");

def de(e, r, t, n):
    return logical_rshift(ctypes.c_int32(r ^ t ^ n).value, 0) if 0 <= e and e < 16 else \
        (logical_rshift(ctypes.c_int32(r & t | r & n | t & n).value, 0) if 16 <= e and e < 64 else -1)

def pe(e, r, t, n):
    return logical_rshift(ctypes.c_int32(r ^ t ^ n).value, 0) if 0 <= e and e < 16 else \
        (logical_rshift(ctypes.c_int32(r & t | ~r & n).value, 0) if 16 <= e and e < 64 else -1)

def compress(arr, reg):
    r = [None for x in range(0, 132)]
    for x in range(0, 16):
        idx = 4 * x
        r[x] = int_overflow(arr[idx] << 24)
        r[x] |= int_overflow(arr[idx + 1] << 16)
        r[x] |= int_overflow(arr[idx + 2] << 8)
        r[x] |= int_overflow(arr[idx + 3])
        r[x] = logical_rshift(r[x], 0)
    # print(f'before: {r}')

    for x in range(16, 68):
        temp = ctypes.c_int32(r[x - 16] ^ r[x - 9] ^ le(r[x - 3], 15)).value
        temp = ctypes.c_int32(temp ^ le(temp, 15) ^ le(temp, 23)).value
        r[x] = logical_rshift(ctypes.c_int32(temp ^ le(r[x - 13], 7) ^ r[x - 6]).value, 0)
    # print('r2: ', r)
    
    for x in range(0, 64):
        r[x + 68] = logical_rshift(ctypes.c_int32(r[x] ^ r[x + 4]).value, 0)

    temp_reg = reg[0:]
    for x in range(0, 64):
        c = le(temp_reg[0], 12) + temp_reg[4] + le(be(x), x)
        c = logical_rshift(ctypes.c_int32(4294967295 & c).value, 0)
        c = le(c, 7)
        s = c ^ le(temp_reg[0], 12)
        u = de(x, temp_reg[0], temp_reg[1], temp_reg[2])
        u = logical_rshift(ctypes.c_int32(4294967295 & (u + temp_reg[3] + s + r[x + 68])).value, 0);
        l = pe(x, temp_reg[4], temp_reg[5], temp_reg[6])
        l = logical_rshift(l + temp_reg[7] + c + r[x], 0)
        l = ctypes.c_int32(4294967295 & l).value
        temp_reg[3] = temp_reg[2]
        temp_reg[2] = le(temp_reg[1], 9)
        temp_reg[1] = temp_reg[0]
        temp_reg[0] = u
        temp_reg[7] = temp_reg[6]
        temp_reg[6] = le(temp_reg[5], 19)
        temp_reg[5] = temp_reg[4]
        temp_reg[4] = logical_rshift(ctypes.c_int32(l ^ le(l, 9) ^ le(l, 17)).value, 0)

    for x in range(0, 8):
        reg[x] = logical_rshift(ctypes.c_int32(reg[x] ^ temp_reg[x]).value, 0)

    return reg

def write(e, size, chunk, reg):
    temp_e = e
    ord_list = []
    if isinstance(temp_e, str):
        n = parse.quote(e)
        l = re.findall('%[0-9A-F]{2}', n)
        if l:
            for x in l:
                idx = e.index(e)
                temp_x = x.replace('%', '')
                temp = binascii.unhexlify(f'00{temp_x}').decode('utf-8')
                end = idx + len(temp)
                e.replace(e[idx:end], temp)
        ord_list = [ord(x) for x in e]
    elif isinstance(temp_e, list):
        ord_list = temp_e
    size = len(ord_list)
    i = 64 - len(chunk)
    temp_chunk = chunk
    if (len(ord_list) < i):
        chunk.extend(ord_list)
    else:
        chunk.extend(ord_list[0:i])
        while(len(chunk) >= 64):
            chunk = compress(chunk, reg)
            print(f'res: {chunk}')
            if i < len(ord_list):
                idx = i + 64 if i + 64 < len(ord_list) else len(ord_list)
                chunk = ord_list[i: idx]
            else:
                chunk = []
            i += 64
    return size, chunk

def fill(arr = [], size = 0):
    temp_size = size * 8
    arr.append(128)
    # print(f'arr1: {len(arr)}')

    while (len(arr) < 56):
        arr.append(0)
    # print(f'arr2: {len(arr)}')
    for x in range(0, 4):
        c = math.floor(temp_size / 4294967296)
        arr.append(logical_rshift(c, ctypes.c_int32(8 * (3 - x) & 255).value))
    # print(f'arr3: {len(arr)}')
    for x in range(0, 4):
        temp_x = logical_rshift(temp_size, ctypes.c_int32(8 * (3 - x) & 255).value)
        arr.append(temp_x)
    # print(f'arr4: {len(arr)}')

    return [arr, size]

def reset():
    reg = [1937774191, 1226093241, 388252375, 3666478592, 2842636476, 372324522, 
        3817729613, 2969243214]
    chunk = []
    size = 0

    return reg, chunk, size

def sum(e):
    reg, chunk, size = reset()
    size, chunk = write(e, 0, [], reg)
    a, b = fill(chunk, size)
    reg = compress(a, reg)
    finall_list = [x for x in range(0, 32)]
    for x in range(0, 8):
        temp = reg[x]
        finall_list[4 * x + 3] = logical_rshift(ctypes.c_int32(255 & temp).value, 0)
        temp = logical_rshift(temp, 8)
        finall_list[4 * x + 2] = logical_rshift(ctypes.c_int32(255 & temp).value, 0)
        temp = logical_rshift(temp, 8)
        finall_list[4 * x + 1] = logical_rshift(ctypes.c_int32(255 & temp).value, 0)
        temp = logical_rshift(temp, 8)
        finall_list[4 * x] = logical_rshift(ctypes.c_int32(255 & temp).value, 0)
    
    return finall_list

def ua2list(const_float=0.00390625, const_int=4):
    a = [x for x in range(0, 256)]
    lm = [chr(int(x)) for x in [const_float, 1, const_int]]
    acc = 0
    for x in range(len(a)):
        x_int = ord(lm[ctypes.c_int32(x % 3).value])
        acc = ctypes.c_int32((acc + a[x] + x_int) % 256).value
        temp = a[x]
        a[x] = a[acc]
        a[acc] = temp

    print(f'ua2list: {a}')
    return a

def getUaList(ua, ua_list):
    if not ua or not ua_list:
        return ''
        
    finally_list, c = [], 0
    for i, _ in enumerate(ua_list):
        if i < len(ua):
            a = ctypes.c_int32(i + 1).value
            b = ctypes.c_int32(a % 256).value
            d = ctypes.c_int32(c + ua_list[b]).value
            c = ctypes.c_int32(d % 256).value
            temp = ua_list[b]
            ua_list[b] = ua_list[c]
            ua_list[c] = temp
            e = ord(ua[i])
            f = ua_list[b] + temp
            g = ctypes.c_int32(f % 256).value
            h = ctypes.c_int32(e ^ ua_list[g]).value
            finally_list.append(h)

    return finally_list
        
def listConvertAscii(l, key="s3"):
    s = {
        "s0": "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
        "s1": "Dkdpgh4ZKsQB80/Mfvw36XI1R25+WUAlEi7NLboqYTOPuzmFjJnryx9HVGcaStCe=",
        "s2": "Dkdpgh4ZKsQB80/Mfvw36XI1R25-WUAlEi7NLboqYTOPuzmFjJnryx9HVGcaStCe=",
        "s3": "ckdp1h4ZKsUB80/Mfvw36XIgR25+WQAlEi7NLboqYTOPuzmFjJnryx9HVGDaStCe",
        "s4": "Dkdpgh2ZmsQB80/MfvV36XI1R45-WUAlEixNLwoqYTOPuzKFjJnry79HbGcaStCe"
    }

    out = ''
    for i in range(math.floor(len(l) / 3)):
        real_i = i * 3
        temp = ctypes.c_int32(l[real_i] << 16).value | ctypes.c_int32(l[real_i + 1] << 8).value | ctypes.c_int32(l[real_i + 2] << 0).value
        s3 = s.get(key, None)
        if not s3:
            raise ValueError('s3不存在')
        
        pos1 = ctypes.c_int32((temp & 16515072) >> 18).value
        out += s3[pos1]
        pos2 = ctypes.c_int32((temp & 258048) >> 12).value
        out += s3[pos2]
        pos3 = ctypes.c_int32((temp & 4032) >> 6).value
        out += s3[pos3]
        pos4 = ctypes.c_int32((temp & 63) >> 0).value
        out += s3[pos4]

    return out

def genNum(bigger_microtimestamp, lesser_microtimestamp, arr1, arr2, arr3, const_float=0.00390625, const_int=8):
    bit_arr, arr = [24, 16, 8, 0], [45,44,1,0,1,1]
    arr1_pos1, arr1_pos2 = 21, 22
    arr2_pos1, arr2_pos2 = 21, 22
    arr3_pos1, arr3_pos2 = 23, 24
    aid = 2631

    print(f'bigger_microtimestamp: {bigger_microtimestamp}')
    print(f'lesser_microtimestamp: {lesser_microtimestamp}')
    print(f'arr1: {arr1}')
    print(f'arr2: {arr2}')
    print(f'arr3: {arr3}')

    for bit in bit_arr:
        arr.append(ctypes.c_int32((bigger_microtimestamp >> bit) & 255).value)
    # arr.extend([0, 0, 0, 0])
    a = bigger_microtimestamp
    for x in range(0, 4):
        a = a / 256
    arr.append(ctypes.c_int32(int(a) >> 0).value)
    a = a / 256
    arr.append(ctypes.c_int32(int(a) >> 0).value)

    arr.extend([0, 0, 0, 0])
    arr.append(ctypes.c_int32(int(const_float) & 255).value)
    arr.append(ctypes.c_int32((1 % 256) & 255).value)
    arr.append(ctypes.c_int32((1 >> 24) & 255).value)
    arr.append(ctypes.c_int32((1 >> 16) & 255).value)
    for bit in bit_arr:
        f = ctypes.c_int32((const_int >> bit) & 255).value
        arr.append(f)
    arr.append(arr1[arr1_pos1])
    arr.append(arr1[arr1_pos2])
    arr.append(arr2[arr2_pos1])
    arr.append(arr2[arr2_pos2])
    arr.append(arr3[arr3_pos1])
    arr.append(arr3[arr3_pos2])

    for bit in bit_arr:
        # arr.append(ctypes.c_int32((bigger_microtimestamp >> bit) & 255).value)
        arr.append(ctypes.c_int32((lesser_microtimestamp >> bit) & 255).value)

    arr.append(3)

    a = lesser_microtimestamp
    for x in range(0, 4):
        a = a / 256
    arr.append(ctypes.c_int32(int(a) >> 0).value)
    a = a / 256
    arr.append(ctypes.c_int32(int(a) >> 0).value)

    for x in bit_arr:
        arr.append(ctypes.c_int32((0 >> x) & 255).value)
    arr.extend([0, aid])
    for x in bit_arr[::-1]:
        arr.append(ctypes.c_int32((aid >> x) & 255).value)

    print(f'arr: {arr}')
    # real_arr = [arr[0], arr[1], 0, arr[9], 0, arr[17], arr[19], arr[21], 
    #             arr[2], 0, arr[10], 0, arr[18], arr[20], arr[22], arr[3], 
    #             0, 0, 0, arr[4], 0, 0, arr[16]]
    # real_arr.extend(arr[23:])
    real_arr = [arr[1], arr[6], 0, 0, 0, 0, arr[44], arr[24], arr[26], 0,
                arr[28], arr[7], 0, 0, 0, arr[11], 0, arr[43], arr[25],
                arr[27], arr[29], arr[8], 0, 0, 0, 0, arr[9], 0, 0, arr[23],
                arr[30], arr[31], 0, arr[32], arr[33], arr[34], arr[10],
                arr[36], arr[35], arr[36], 76, 0, 0, 0]
    print(f'real_arr: {real_arr}')
    last_num = 0
    for x, v in enumerate(real_arr):
        if x == 1:
            last_num = arr[x] ^ v
        else:
            last_num = last_num ^ real_arr[x]

    real_arr.append(last_num)
    return real_arr

def genAbogusPrefix3(random_float):
    random_float = random_float * 10000
    n1 = ctypes.c_int32(logical_rshift(int(random_float), 0) & 255).value
    n2 = ctypes.c_int32(logical_rshift(int(random_float), 8) & 255).value
    arr = []
    arr.append(ctypes.c_int32((n1 & 170) + 1).value)
    arr.append(ctypes.c_int32((n1 & 85)).value)
    arr.append(ctypes.c_int32((n2 & 170) + 1).value)
    arr.append(ctypes.c_int32((n2 & 85)).value)

    return arr

def genAbogusPrefix2(random_float):
    random_float = random_float * 10000
    n1 = ctypes.c_int32(logical_rshift(int(random_float), 0) & 255).value
    n2 = ctypes.c_int32(logical_rshift(int(random_float), 8) & 255).value
    arr = []
    arr.append(ctypes.c_int32((n1 & 170) + 1).value)
    arr.append(ctypes.c_int32((n1 & 85)).value)
    arr.append(ctypes.c_int32((n2 & 170)).value)
    arr.append(ctypes.c_int32((n2 & 85)).value)

    return arr

def genAbogusPrefix1(random_float):
    random_float = random_float * 10000
    n1 = ctypes.c_int32(logical_rshift(int(random_float), 0) & 255).value
    n2 = ctypes.c_int32(logical_rshift(int(random_float), 8) & 255).value
    arr = []
    arr.append(ctypes.c_int32((n1 & 170) + 1).value)
    arr.append(ctypes.c_int32((n1 & 85) + 2).value)
    arr.append(ctypes.c_int32((n2 & 170) + 5).value)
    arr.append(ctypes.c_int32((n2 & 85) + 40).value)

    return arr

def genAbogusPrefixV1(microtimestamp):
    n1 = ctypes.c_int32(logical_rshift(microtimestamp, 0) & 255).value
    n2 = ctypes.c_int32(logical_rshift(microtimestamp, 8) & 255).value
    arr = []
    arr.append(ctypes.c_int32((n1 & 170) + 1).value)
    arr.append(ctypes.c_int32((n1 & 85) + 2).value)
    arr.append(ctypes.c_int32((n2 & 170) + 64).value)
    arr.append(ctypes.c_int32((n2 & 85) + 2).value)

    return arr

def genScreenArr(screen_info):
    # screen_info = '1344|697|1344|784|-380|-1376|0|0|2560|1415|2560|1440|1344|697|24|24|MacIntel'
    """
        js获取
        let d = {
            "innerWidth": window.innerWidth,
            "innerHeight": window.innerHeight,
            "outerWidth": window.outerWidth,
            "outerHeight": window.outerHeight,
            "screenX": window.screenX,
            "screenY": window.screenY,
            "pageXOffset": window.pageXOffset,
            "pageYOffset": window.pageYOffset,
            "availWidth":window.screen.availWidth,
            "availHeight":window.screen.availHeight,
            "sizeWidth":window.screen.width,
            "sizeHeight":window.screen.height,
            "clientWidth":document.body.clientWidth,
            "clientHeight":document.body.clientHeight,
            "colorDepth":window.screen.colorDepth,
            "pixelDepth":window.screen.pixelDepth
        };
        let s = Object.keys(d).map((x) => { return d[x] }).join('|') + '|' + navigator.platform
    """
    screen_list = []
    if not screen_info:
        return screen_list
    
    for x in screen_info:
        screen_list.append(ord(x))
    return screen_list

def genAbogusSuffix(arr):
    if not arr:
        return ''
    
    arr_256 = [
        121,243,55,234,103,36,47,228,30,231,106,6,115,
        95,78,101,250,207,198,50,139,227,220,105,97,
        143,34,28,194,215,18,100,159,160,43,8,169,217,
        180,120,247,45,90,11,27,197,46,3,84,72,5,68,
        62,56,221,75,144,79,73,161,178,81,64,187,134,
        117,186,118,16,241,130,71,89,147,122,129,65,40,
        88,150,110,219,199,255,181,254,48,4,195,248,208,
        32,116,167,69,201,17,124,125,104,96,83,80,127,
        236,108,154,126,204,15,20,135,112,158,13,1,188,
        164,210,237,222,98,212,77,253,42,170,202,26,22,
        29,182,251,10,173,152,58,138,54,141,185,33,157,
        31,252,132,233,235,102,196,191,223,240,148,39,
        123,92,82,128,109,57,24,38,113,209,245,2,119,153,
        229,189,214,230,174,232,63,52,205,86,140,66,175,
        111,171,246,133,238,193,99,60,74,91,225,51,76,37,
        145,211,166,151,213,206,0,200,244,176,218,44,184,
        172,49,216,93,168,53,21,183,41,67,85,224,155,226,
        242,87,177,146,70,190,12,162,19,137,114,25,165,163,
        192,23,59,9,94,179,107,35,7,142,131,239,203,149,
        136,61,249,14,156]
    
    arr_length = len(arr)
    temp = 0
    indexes = [94,145,117,180,145,9,58,214,146,10,126,154,42,149,75,252,115,103,65,238,44,184,51,184,22,166,202,81,89,213,199,191,61,52,247,193,173,226,68,2,63,86,164,196,21,56,133,242,205,79,158,190,190,224,55,152,157,2,241,216,68,154,210,102,240,184,62,101,229,72,2,218,117,167,38,144,220,101,156,64,182,30,201,166,177,159,35,162,153,98,181,123,3,246,134,210,104,191,247,93,127,43,142,252,108,151,78,180,147,55,242,168,45,137,217,243,26,35,53,189,193]
    return_arr = []
    out = ''
    for x in range(0, arr_length):
        idx = x + 1
        temp = (temp + arr_256[idx]) % 256
        swap_temp = arr_256[temp]
        arr_256[temp] = arr_256[idx]
        arr_256[idx] = swap_temp

        val = arr[x] ^ arr_256[indexes[x]]
        return_arr.append(val)
        out += chr(val)

    print(f'out: {out}')
    return return_arr

def genAbogusSuffixV1(arr):
    if not arr:
        return ''
    
    arr_256 = [
        62,17,163,235,54,24,170,7,222,123,210,20,206,127,
        179,162,78,199,21,227,37,77,171,5,224,26,3,114,
        176,89,151,57,220,100,69,70,28,254,60,58,113,92,
        73,18,186,98,228,152,75,255,64,23,232,244,109,81,
        84,79,65,49,190,126,63,148,195,88,14,96,10,30,99,
        201,245,193,39,108,51,4,103,132,239,182,139,97,226,
        229,212,102,48,144,125,216,107,15,207,1,74,247,130,
        143,184,61,217,189,149,225,211,204,253,145,241,194,
        214,202,236,47,121,164,157,93,8,196,67,34,118,25,59,
        72,44,158,146,166,243,208,87,111,155,90,46,32,105,
        147,173,11,246,153,141,140,104,234,124,122,35,150,
        110,238,38,160,167,174,115,112,66,169,95,117,36,221,
        252,68,53,131,156,133,213,198,161,101,83,159,76,116,
        142,91,9,12,178,205,55,209,137,183,120,197,19,180,
        172,71,181,135,22,231,233,86,27,154,80,192,175,56,
        31,177,2,242,203,251,106,168,119,42,248,165,185,187,
        33,129,237,138,230,191,250,29,40,41,45,240,52,136,6,
        94,43,134,16,200,215,82,13,249,85,188,0,50,219,128,
        218,223
    ]
    # idx = [24,47,38,130,51,71,32,182,70,206,75,252,74,199,113,234,246,176,175,27,242,192,152,113,137,209,77,254,116]
    idx = [94,145,117,180,145,9,58,214,146,10,126,154,42,149,75,252,115,103,65,238,44,184,51,184,22,166,202,81,89,213,199,191,61,52,247,193,173,226,68,2,63,86,164,196,21,56,133,242,205,79,158,190,190,224,55,152,157,2,241,216,68,154,210,102,240,184,62,101,229,72,2,218,117,167,38,144,220,101,156,64,182,30,201,166,177,159,35,162,153,98,181,123,3,246,134,210,104,191,247,93,127,43,142,252,108,151,78,180,147,55,242,168,45,137]
    out = ''
    return_arr = []
    for i, v in enumerate(arr):
        val = ctypes.c_int32(v ^ arr_256[idx[i]]).value
        out += chr(val)
        return_arr.append(val)

    return return_arr
    # return out

def genAbogus(query, body, ua, screen_info, const_float=0.00390625, const_int=8):
    arr1 = sum(sum(query + 'cus'))
    arr2 = sum(sum(body + 'cus'))
    arr3 = sum(listConvertAscii(getUaList(ua, ua2list(const_float, const_int))))

    lesser_microtimestamp = int(time.time() * 1000)
    bigger_microtimestamp = int(time.time() * 1000) + 16
    
    r = genNum(bigger_microtimestamp, lesser_microtimestamp, arr1, arr2, arr3, const_float, const_int)
    last_num = r.pop()
    screen_arr = genScreenArr(screen_info)
    r.extend(screen_arr)
    r.append(last_num)

    random1 = random.random()
    # random1 = 0.7262206855465463
    abogus = genAbogusPrefix1(random1)
    random2 = random.random()
    # random2 = 0.31260696051255077
    abogus.extend(genAbogusPrefix2(random2))
    random3 = random.random()
    # random3 = 0.03311036601192585
    abogus.extend(genAbogusPrefix3(random3))
    abogus.extend(genAbogusSuffix(r))
    print(f'listConvertAscii: {abogus}')
    abogus = listConvertAscii(abogus, "s4")
    return abogus

def genAbogusV1(query,body,ua,const_float=0.00390625,const_int=4):
    arr1 = sum(sum(query + 'cus'))
    arr2 = sum(sum(body + 'cus'))
    ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
    print(f'ua: {listConvertAscii(getUaList(ua, ua2list(const_float, const_int)))}')
    arr3 = sum(listConvertAscii(getUaList(ua, ua2list(const_float, const_int))))
    print(f'arr3: {listConvertAscii(getUaList(ua, ua2list(const_float, const_int)))}')

    # lesser_microtimestamp = int(time.time() * 1000)
    # bigger_microtimestamp = int(time.time() * 1000) + 16
    # 16-5
    # lesser_microtimestamp = 1705414540890
    # bigger_microtimestamp = 1705414540908
    # 17-1
    lesser_microtimestamp = 1705495892865
    bigger_microtimestamp = 1705495892880
    # 18-1
    # lesser_microtimestamp = 1705580168867
    # bigger_microtimestamp = 1705580168881
    # 2-=6
    lesser_microtimestamp = 1705769879394
    bigger_microtimestamp = 1705769879406
    
    microtimestamp = lesser_microtimestamp + random.randint(3000, 3100)
    r = genNum(bigger_microtimestamp, lesser_microtimestamp, arr1, arr2, arr3)
    # print(r)

    microtimestamp = int(time.time() * 1000)
    # print(f'microtimestamp: {microtimestamp}')
    abogus_prefix = genAbogusPrefixV1(microtimestamp)
    # print(f'abogus_prefix: {abogus_prefix}')
    abogus_suffix = genAbogusSuffix(r)
    # print(f'abogus_suffix: {abogus_suffix}')
    abogus_prefix.extend(abogus_suffix)
    # print(f'abogus_arr: {abogus_prefix}')
    a_bogus = listConvertAscii(abogus_prefix, "s4")
    # print(f'res: {a_bogus}')


# query = 'verifyFp=verify_lppjml0j_HUOchQJZ_AfgO_4zuR_AVfU_vFNv0hyDUdOC&fp=verify_lppjml0j_HUOchQJZ_AfgO_4zuR_AVfU_vFNv0hyDUdOC&msToken=3_Xfl9Kx0I5VUTpqG4RgLbi_qXh2Fi-1OuIueos_BJWctxJHCQvW1UjwtBrzyLIqZl6uEfxQTgN1x3Q8k3ECz_uOWpJ-r4p_wiqjyrYl03vtwcWcApo0'
# body = '{"page":1,"refresh":true,"type":1,"search_id":"","filters":{"content_type":[],"total_sales":[],"live_total_sales":[],"video_total_sales":[],"image_text_total_sales":[],"windows_total_sales":[],"live_sale_avg":[],"live_watching_times":[],"video_sale_single":[],"video_play_time":[],"image_text_sale_single":[],"image_text_play_time":[],"window_order_cnt":[],"window_product_cnt":[],"main_cate":["5"],"author_level":[],"fans_num":[],"author_portrait":[],"fan_portrait":[],"can_connect":[],"high_response_rate_im":[],"has_contact":[],"only_commission":[],"commission_quotation":[],"sale_reputation":[],"merchant_info":[]}}'


# # mac
# # ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
# # win
# ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36'
# screen_info = '1344|697|1344|784|-380|-1376|0|0|2560|1415|2560|1440|1344|697|24|24|MacIntel'
# 18-4
# mac
# screen_info = '1280|641|1280|728|-464|-1388|0|0|2560|1415|2560|1440|1280|641|24|24|MacIntel'
# screen_info = '1280|641|1280|728|-464|-1388|0|0|2560|1415|2560|1440|1280|641|24|24|MacIntel'
# win
# screen_info = '1512|875|1528|971|134|61|0|0|1920|1040|1920|1080|1495|875|24|24|Win32'
screen_info = '1725|1028|1741|1158|360|160|0|173|2560|1400|2560|1440|1708|1028|24|24|Win32'

# abogus = genAbogus(query,body,ua,screen_info,0.00390625,0)
# print(f'abogus: {abogus}')

# query = 'account_type=1&account_id=v2_0a2c71c94fc258ede662a4dd6a897ae0ed94ae66a0176421b362636f4606a702d0992ad491509be5d8708f62a4121a4b0a3cf9d146fb3541bcf8ff676aa71ac07761b3a0bd2fa194dee81197b8390fd75ab5f2407a5ffb3456e62046cce9ed22021d8c607f5936443cc83b7a6e7e10c9b5c70d18e5ade4c90120012201034035c027&account_app_id=1128&check_type=1&verifyFp=verify_lpfgy7sz_tdwd60P6_2b7C_4Vlw_9Am8_UkSraoVogPcV&fp=verify_lpfgy7sz_tdwd60P6_2b7C_4Vlw_9Am8_UkSraoVogPcV&msToken=4y03jfLNUvhenTviDl2qZnvGxAHeNWDF26aDgxra1KYDmlZLojhAwP7dSz64Ko_vD_2o50kEeTKKBus4mMajIehXOGW4oTL4AZ4c_2Niwd-KLuONISsEEizjsUSskbc%3D'
# body = ''
# abogus = genAbogus(query,body,ua,screen_info,0.00390625,0)
# print(f'abogus: {abogus}')


# windows
# passport_csrf_token=305c00912c9ae072608830dde34614cf; passport_csrf_token_default=305c00912c9ae072608830dde34614cf; s_v_web_id=; scmVer=1.0.1.6240; _tea_utm_cache_3813=undefined; PHPSESSID=8d3127d211296ea34744a76bf50d4b65; PHPSESSID_SS=8d3127d211296ea34744a76bf50d4b65; SASID=SID2_3666243216522508398; BUYIN_SASID=SID2_3666243216522508398; buyin_app_id=13; buyin_shop_type=11; buyin_account_child_type=1; buyin_app_id_v2=13; buyin_shop_type_v2=11; buyin_account_child_type_v2=1; msToken=
# query = 'type=1&verifyFp=verify_lrxc4e2m_lybETCZ5_8pdg_4wik_84JU_Lxs9bO0A2e7t&fp=verify_lrxc4e2m_lybETCZ5_8pdg_4wik_84JU_Lxs9bO0A2e7t&msToken=PzGP2vmh1G4vMWXuUA58KTpy4kpqkNiiCIGcYoF4N4kV-FNBhDaYMzQtniJkFtOZrqhSyHT-iy-JlAc1blK8VM-N_faS7MTHra7pqt389XfRnDYM_lfUIzlVDqzgn1w='
# body = ''
# screen_info = '1626|919|1626|1006|-564|-1336|0|0|2560|1415|2560|1440|1626|919|24|24|MacIntel'
# ua = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
# abogus = genAbogus(query,body,ua,screen_info,0.00390625,8)
# print(f'abogus: {abogus}')
